package top.lisicheng.listener;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

/**
 * @author Lisicheng
 */
// @Component
@EnableBinding(Sink.class)
public class MsgListener {

    @StreamListener(Sink.INPUT)
    public void read(Message<String> message) {

        System.out.println("head:" + message.getPayload());
        System.out.println("body:" + message.getPayload());
        System.out.println("-------------------------");

    }

}
